The FieldToFile XCMD allows you to save the contents of a HyperCard field in a text file. You may designate the file to save to by passing its full pathname, or by choosing its folder and typing its name in a standard file dialog box. FieldToFile does not append to existing files--it replaces them. Therefore, if you supply the full pathname of the file, you should make sure you won't be replacing something vital.
If the standard file dialog is invoked, FieldToFile passes the short name of the field to SFPutFile as the original name of the file.
If an error occurs, FieldToFile returns an error message as the Result. Word 1 of this message will be "Error." If the file was written successfully, FieldToFile returns the full pathname of the file as the Result.
INVOKING FIELDTOFILE
You may designate the field from which the text is to be copied in any way considered valid by HyperCard, by number, id, or name, with one exception: you can't use the field's name if it is more than one word. If you do use the field's name, don't put the field name in quotation marks. Nested quotations confuse HyperCard. (See the examples below.)
If you don't supply the pathname of the file to be written to, FileToField will invoke SFPutFile, and the user can specify the file's name and directory using the dialog box. If the user pushes the cancel buton of the dialog box, FileToField returns "Cancel" as the Result.
If you want to be able to open your favorite word processor by double-clicking on the text file, you must supply the creator parameter. For MacWrite, the creator is "MACA." For Microsoft Word, the creator is "MSWD."
FieldToFile fieldDesignation,<full pathname of file>,<creator>
examples--
FieldToFile "bkgnd field id 3" --FieldToFile will invoke standard file
FieldToFile "card field 5","TheFattaTheLand:Drop Folder:My Homework"
FieldToFile "field 1","MyHD:MyFile","MACA"
REVISION HISTORY
1.0 -- 3/7/88
1.2 --4/8/88 -- now saves to an AppleShare Drop Folder